    $(function(){
       if($("#adminLoginStatus").val()=="1"){
            alert("动态验证码错误！")
        }
        Victor("container", "output");   //登录背景函数
        $("#entry_name").focus();
        $(document).keydown(function(event){
            if(event.keyCode==13){
                $("#btn_login").click();
            }
        });
        $("#btn_login").on("click",function () {
            var username=$("#entry_name").val()
            var password=$("#entry_password").val()
            //alert(username+"|"+password)
            $.ajax({
                type:"get",
                data:{username:username,password:password},
                dataType: "json",
                url:"http://127.0.0.1:8080/check_role",
                success:function(data){
                  //  alert("ajax成功");
                    if(data.status==0&&data.data==2){
                        var judge = prompt("当前账号为管理员账号，请输入动态验证码：");
                        if (judge.trim()) {
                            formpost("http://127.0.0.1:8080/check_GoogleAuthenticator",{'code':judge});
                        } else {
                            alert("已取消")
                        }
                    }else if(data.status==0&&data.data==1){
                        formpost("http://127.0.0.1:8080/show_staffMain",{'username':username});
                    }else {
                        alert("用户名或密码错误！")
                    }

                },

                error:function () {
                    alert("ajax错误");
                }
            });

        })
        function formpost(url, postData) {
            var tempform = document.createElement("form");
            tempform.action = url;
            tempform.target = "_self";
            tempform.method = "post";
            tempform.style.display = "none";
            for (var x in postData) {
                var opt = document.createElement("textarea");
                opt.name = x;
                opt.value = postData[x];
                tempform.appendChild(opt);
            }
            document.body.appendChild(tempform);
            tempform.submit();
        }

    });